package gameObject
{
	import away3d.containers.ObjectContainer3D;
	
	import controller.GameControllerBase;
	
	import gameObject.resources3D.ResourceBase;
	
	
	/**
	 * 与gameControllerBase一起组成一个组合
	 * 这样就可以用比如这种方式操作：gameObject.controller = new Controller();
	 * 
	 * ObjectContainer3D相当于3D的sprite的容器，可以收发事件，有自己的坐标之类的参数
	 */	
	public class GameObjectBase extends ObjectContainer3D
	{
		protected var _controller:GameControllerBase;
		protected var _resource:ResourceBase;
		
		public function GameObjectBase()
		{
			super();
		}

		public function get resource():ResourceBase
		{
			return _resource;
		}
		
		public function set controller(Controller:GameControllerBase):void
		{
			if(Controller)Controller.setup(this);
			_controller = Controller;
		}
		
		public function get controller():GameControllerBase
		{
			return _controller;
		}
		
		public function disposeController():void
		{
			if(_controller)_controller.dispose();
		}
	}
}